package com.bw.liuyushan.mvp_lib.VIew;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bw.liuyushan.mvp_lib.Presenter.IPresenter;

/**
 * Liuyushan20210904
 * file name is : BaseActivity
 * created by Ender on 2021/9/4 8:13.
 * author : 刘雨杉
 * Describe:
 */
public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivity implements IActivity,IView {
    protected P mPresenter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(bindLayout());
        initView();
        initDate();

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mPresenter!=null){
            mPresenter.Destory();
            mPresenter=null;
        }
    }
}
